package com.turbo.cloud.core.annotations.datamasking.masker;

import com.turbo.cloud.core.annotations.datamasking.DataMaskingType;
import com.turbo.cloud.core.annotations.datamasking.processor.DataMaskingProcessor;
import org.springframework.stereotype.Component;

/**
 * 脱敏执行类
 *
 * @author zhangluning
 */
@Component
public class DataMasker implements Masker {
    /**
     * 自定义脱敏方法
     *
     * @param dataMaskingType 脱敏类型
     * @param sourceValue     原值
     * @return String
     */
    @Override
    public String masking(DataMaskingType dataMaskingType, String sourceValue) {
        return DataMaskingProcessor.process(dataMaskingType, sourceValue);
    }
}
